<template>
  <!-- 治疗记录 -->
  <el-dialog title="治疗记录" :visible="value" width="400px" custom-class="dialog-box" @close="onClose" @open="onOpen" :close-on-click-modal="false" :append-to-body="true">
    <table class="table-box">
      <thead>
        <tr>
          <th>治疗人员</th>
          <th>治疗次数</th>
          <th>时间</th>
        </tr>
      </thead>
      <tbody>
        <tr v-for="(item,index) in tableList" :key="index">
          <td>{{item.adviceUserName}}</td>
          <td>{{item.adviceNum}}</td>
          <td>{{item.adviceTime}}</td>
        </tr>
      </tbody>
    </table>
    <div v-if="tableList.length == 0" style="color:#999;padding:10px 0;text-align:center;">
      <i class="iconfont iconwushuju" style="font-size:40px;"></i>
      <div>暂无数据</div>
    </div>
  </el-dialog>
</template>
<script>
export default {
  props: ["value", "curItem"],
  data() {
    return {
      tableList: []
    };
  },
  methods: {
    onOpen() {
      let th = this;
      th.$nextTick(function() {
        th.tableList = th.curItem.adviceJournalVOS;
      });
    },
    onClose() {
      let th = this;
      th.$emit("input", false);
    }
  }
};
</script> 

